home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / tptc17tc.zip / POINT4.PAS < prev    next >
Pascal/Delphi Source File  |  1988-03-25  |  561b  |  31 lines

  1.  
  2. (*
  3.  * Another example of pointer manipulation
  4.  *
  5.  *)
  6.  
  7. type 
  8.     Int_Point = ^Integer;
  9.  
  10. var 
  11.     Index         : Integer;
  12.     Where         : ^Integer;
  13.     Who           : ^Integer;
  14.     Pt1, Pt2, Pt3 : Int_Point;
  15.  
  16. begin
  17.    Index := 17;
  18.    Where := @Index;
  19.    Who := @Index;
  20.    Writeln('The values are   ',Index:5,Where^:5,Who^:5);
  21.  
  22.    Where^ := 23;
  23.    Writeln('The values are   ',Index:5,Where^:5,Who^:5);
  24.  
  25.    Pt1 := @Index;
  26.    Pt2 := Pt1;
  27.    Pt3 := Pt2;
  28.    Pt2^ := 151;
  29.    Writeln('The Pt values are',Pt1^:5,Pt2^:5,Pt3^:5);
  30. end.
  31.